package com.rightsidetech.mall.dto.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
public class IntegralUpReq implements Serializable {

    @ApiModelProperty(value = "积分商品id",required = true)
    @NotNull(message = "积分商品id不可为空")
    @Min(value = 0,message = "id不可为负数")
    private Long id;

    @ApiModelProperty(value = "商品封面图",required = true)
    @NotBlank(message = "商品封面图不可为空")
    @Pattern(regexp = "^http://.*|https://.*",message = "图片应该是一个url地址")
    private String cover;

    @ApiModelProperty(value = "积分价格",required = true)
    @NotNull(message = "积分价格不可为空")
    @Range(min = 0,max = 999999999999L,message = "商品价格超出最大范围、或不能为负数")
    private BigDecimal price;

    @ApiModelProperty(value = "划线价",required = true)
    @NotNull(message = "划线价不可为空")
    @Range(min = 0,max = 999999999999L,message = "商品划线价格超出最大范围、或不能为负数")
    private BigDecimal underlinedPrice;

    @ApiModelProperty(value = "库存",required = true)
    @NotNull(message = "库存不可为空")
    @Min(value = 0,message = "库存不可为负数")
    private Integer stock;

    @ApiModelProperty("规格")
    private DetailSpecsReq specs;

}
